﻿package PaperMan// ActionScript file
{
	import flash.display.DisplayObject;
	import flash.display.DisplayObjectContainer;
	import flash.display.MovieClip;
	import flash.system.ApplicationDomain;

	public class PaperManComponent extends BMPMC_Cartoon
	{
		private var _motionName:String;
		private var _defaultPartsObj:Object;
		private var _part0Str:String;
		private var _part1Str:String;
		private var _part2Str:String;
		private var _part3Str:String;
		private var _part4Str:String;
		private var _part5Str:String;
		private var _part6Str:String;
		private var _part7Str:String;
		private var _part8Str:String;
		private var _part9Str:String;
		private var _part10Str:String;
		private var _part11Str:String;
		private var _part12Str:String;
		private var _part13Str:String;
		private var _part14Str:String;
		private var _part15Str:String;
		private var _part16Str:String;
		private var _part17Str:String;
		private var _part18Str:String;
		private var _part19Str:String;
		private var _part20Str:String;
		private var _part21Str:String;
		private var _part22Str:String;
		private var _part23Str:String;
		private var _part24Str:String;
		private var _part25Str:String;
		private var _part26Str:String;
		private var _part27Str:String;
		private var _part28Str:String;
		private var _part29Str:String;
		private var _part30Str:String;
		private var _part31Str:String;
		private var _part32Str:String;
		private var _part33Str:String;
		private var _part34Str:String;
		private var _part35Str:String;
		private var _part36Str:String;
		private var _part37Str:String;
		private var _part38Str:String;
		private var _part39Str:String;
		public function PaperManComponent():void
		{
			this.init();
		}
		
		public function init():void
		{
			this.isStop=true;
			this.motionName="defaultMotion";
			this.drawNow();
		}
		
		public function setSize(width:Number,height:Number):void
		{
			
		}
		
		public function updateParts():void
		{
			this._defaultPartsObj=new Object;
			for(var k:String in this.partsObj)
			{
				var checkPart:DisplayObject=this.partsObj[k];
				if(checkPart && checkPart is DisplayObjectContainer)
				{
					this.defaultPartsObj[k]=(checkPart as DisplayObjectContainer).getChildAt(0);
				}
			}
		}
		
		public function changePart(partName:String,changeValue:String):Boolean
		{
			var changeDisplayObj:DisplayObject;
			if(changeValue=="default")
			{
				changeDisplayObj=this.defaultPartsObj[partName];
				if(changeDisplayObj)
				{
					try
					{
						this.changePartSource(partName,changeDisplayObj);
					}
					catch(e:Error)
					{
						
					}
				}
			}
			else if(changeValue=="invisibled")
			{
				this.changePartInvisibled(partName);
			}
			else
			{
				if(ApplicationDomain.currentDomain.hasDefinition(changeValue))
				{
					changeDisplayObj=new (ApplicationDomain.currentDomain.getDefinition(changeValue) as Class) as DisplayObject;
					if(changeDisplayObj)
					{
						try
						{
							this.changePartSource(partName,changeDisplayObj);
						}
						catch(e:Error)
						{
							return false;
						}
					}
				}
				else
				{
					return false;
				}
			}
			return true;
		}

		/*getter & setter*/
		public function get defaultPartsObj():Object
		{
			return _defaultPartsObj;
		}
		
		[Inspectable(defaultValue="defaultMotion",type="String")]
		public function get motionName():String
		{
			return _motionName;
		}

		public function set motionName(value:String):void
		{
			if(value==this.motionName)return;
			if(ApplicationDomain.currentDomain.hasDefinition(value))
			{
				var motionMC:MovieClip=(new (ApplicationDomain.currentDomain.getDefinition(value) as Class)) as MovieClip;
				if(motionMC)
				{
					this.setSourceMC(motionMC);
					this._motionName=value;
					this.updateParts();
				}
			}
		}
		
		[Inspectable(type="String",defaultValue="default")]
		public function get part0Str():String
		{
			return _part0Str;
		}
		
		public function set part0Str(value:String):void
		{
			if(value!=this.part0Str && this.changePart("part0",value))
			{
				_part0Str=value;
			}
		}

		[Inspectable(type="String",defaultValue="default")]
		public function get part1Str():String
		{
			return _part1Str;
		}
		
		public function set part1Str(value:String):void
		{
			if(value!=this.part1Str && this.changePart("part1",value))
			{
				_part1Str=value;
			}
		}
		
		[Inspectable(type="String",defaultValue="default")]
		public function get part2Str():String
		{
			return _part2Str;
		}
		
		public function set part2Str(value:String):void
		{
			if(value!=this.part2Str && this.changePart("part2",value))
			{
				_part2Str=value;
			}
		}
		
		[Inspectable(type="String",defaultValue="default")]
		public function get part3Str():String
		{
			return _part3Str;
		}
		
		public function set part3Str(value:String):void
		{
			if(value!=this.part3Str && this.changePart("part3",value))
			{
				_part3Str=value;
			}
		}
		
		[Inspectable(type="String",defaultValue="default")]
		public function get part4Str():String
		{
			return _part4Str;
		}
		
		public function set part4Str(value:String):void
		{
			if(value!=this.part4Str && this.changePart("part4",value))
			{
				_part4Str=value;
			}
		}
		
		[Inspectable(type="String",defaultValue="default")]
		public function get part5Str():String
		{
			return _part5Str;
		}
		
		public function set part5Str(value:String):void
		{
			if(value!=this.part5Str && this.changePart("part5",value))
			{
				_part5Str=value;
			}
		}

		[Inspectable(type="String",defaultValue="default")]
		public function get part6Str():String
		{
			return _part6Str;
		}
		
		public function set part6Str(value:String):void
		{
			if(value!=this.part6Str && this.changePart("part6",value))
			{
				_part6Str=value;
			}
		}
		
		[Inspectable(type="String",defaultValue="default")]
		public function get part7Str():String
		{
			return _part7Str;
		}
		
		public function set part7Str(value:String):void
		{
			if(value!=this.part7Str && this.changePart("part7",value))
			{
				_part7Str=value;
			}
		}
		
		[Inspectable(type="String",defaultValue="default")]
		public function get part8Str():String
		{
			return _part8Str;
		}
		
		public function set part8Str(value:String):void
		{
			if(value!=this.part8Str && this.changePart("part8",value))
			{
				_part8Str=value;
			}
		}
		
		[Inspectable(type="String",defaultValue="default")]
		public function get part9Str():String
		{
			return _part9Str;
		}
		
		public function set part9Str(value:String):void
		{
			if(value!=this.part9Str && this.changePart("part9",value))
			{
				_part9Str=value;
			}
		}
		
		[Inspectable(type="String",defaultValue="default")]
		public function get part10Str():String
		{
			return _part10Str;
		}
		
		public function set part10Str(value:String):void
		{
			if(value!=this.part10Str && this.changePart("part10",value))
			{
				_part10Str=value;
			}
		}
		
		[Inspectable(type="String",defaultValue="default")]
		public function get part11Str():String
		{
			return _part11Str;
		}
		
		public function set part11Str(value:String):void
		{
			if(value!=this.part11Str && this.changePart("part11",value))
			{
				_part11Str=value;
			}
		}
		
		[Inspectable(type="String",defaultValue="default")]
		public function get part12Str():String
		{
			return _part12Str;
		}
		
		public function set part12Str(value:String):void
		{
			if(value!=this.part12Str && this.changePart("part12",value))
			{
				_part12Str=value;
			}
		}
		
		[Inspectable(type="String",defaultValue="default")]
		public function get part13Str():String
		{
			return _part13Str;
		}
		
		public function set part13Str(value:String):void
		{
			if(value!=this.part13Str && this.changePart("part13",value))
			{
				_part13Str=value;
			}
		}
		
		[Inspectable(type="String",defaultValue="default")]
		public function get part14Str():String
		{
			return _part14Str;
		}
		
		public function set part14Str(value:String):void
		{
			if(value!=this.part14Str && this.changePart("part14",value))
			{
				_part14Str=value;
			}
		}
		
		[Inspectable(type="String",defaultValue="default")]
		public function get part15Str():String
		{
			return _part15Str;
		}
		
		public function set part15Str(value:String):void
		{
			if(value!=this.part15Str && this.changePart("part15",value))
			{
				_part15Str=value;
			}
		}
		
		[Inspectable(type="String",defaultValue="default")]
		public function get part16Str():String
		{
			return _part16Str;
		}
		
		public function set part16Str(value:String):void
		{
			if(value!=this.part16Str && this.changePart("part16",value))
			{
				_part16Str=value;
			}
		}
		
		[Inspectable(type="String",defaultValue="default")]
		public function get part17Str():String
		{
			return _part17Str;
		}
		
		public function set part17Str(value:String):void
		{
			if(value!=this.part17Str && this.changePart("part17",value))
			{
				_part17Str=value;
			}
		}
		
		[Inspectable(type="String",defaultValue="default")]
		public function get part18Str():String
		{
			return _part18Str;
		}
		
		public function set part18Str(value:String):void
		{
			if(value!=this.part18Str && this.changePart("part18",value))
			{
				_part18Str=value;
			}
		}
		
		[Inspectable(type="String",defaultValue="default")]
		public function get part19Str():String
		{
			return _part19Str;
		}
		
		public function set part19Str(value:String):void
		{
			if(value!=this.part19Str && this.changePart("part19",value))
			{
				_part19Str=value;
			}
		}
		
		[Inspectable(type="String",defaultValue="default")]
		public function get part20Str():String
		{
			return _part20Str;
		}
		
		public function set part20Str(value:String):void
		{
			if(value!=this.part20Str && this.changePart("part20",value))
			{
				_part20Str=value;
			}
		}
		
		[Inspectable(type="String",defaultValue="default")]
		public function get part21Str():String
		{
			return _part21Str;
		}
		
		public function set part21Str(value:String):void
		{
			if(value!=this.part21Str && this.changePart("part21",value))
			{
				_part21Str=value;
			}
		}
		
		[Inspectable(type="String",defaultValue="default")]
		public function get part22Str():String
		{
			return _part22Str;
		}
		
		public function set part22Str(value:String):void
		{
			if(value!=this.part22Str && this.changePart("part22",value))
			{
				_part22Str=value;
			}
		}
		
		[Inspectable(type="String",defaultValue="default")]
		public function get part23Str():String
		{
			return _part23Str;
		}
		
		public function set part23Str(value:String):void
		{
			if(value!=this.part23Str && this.changePart("part23",value))
			{
				_part23Str=value;
			}
		}
		
		[Inspectable(type="String",defaultValue="default")]
		public function get part24Str():String
		{
			return _part24Str;
		}
		
		public function set part24Str(value:String):void
		{
			if(value!=this.part24Str && this.changePart("part24",value))
			{
				_part24Str=value;
			}
		}
		
		[Inspectable(type="String",defaultValue="default")]
		public function get part25Str():String
		{
			return _part25Str;
		}
		
		public function set part25Str(value:String):void
		{
			if(value!=this.part25Str && this.changePart("part25",value))
			{
				_part25Str=value;
			}
		}
		
		[Inspectable(type="String",defaultValue="default")]
		public function get part26Str():String
		{
			return _part26Str;
		}
		
		public function set part26Str(value:String):void
		{
			if(value!=this.part26Str && this.changePart("part26",value))
			{
				_part26Str=value;
			}
		}
		
		[Inspectable(type="String",defaultValue="default")]
		public function get part27Str():String
		{
			return _part27Str;
		}
		
		public function set part27Str(value:String):void
		{
			if(value!=this.part27Str && this.changePart("part27",value))
			{
				_part27Str=value;
			}
		}
		
		[Inspectable(type="String",defaultValue="default")]
		public function get part28Str():String
		{
			return _part28Str;
		}
		
		public function set part28Str(value:String):void
		{
			if(value!=this.part28Str && this.changePart("part28",value))
			{
				_part28Str=value;
			}
		}
		
		[Inspectable(type="String",defaultValue="default")]
		public function get part29Str():String
		{
			return _part29Str;
		}
		
		public function set part29Str(value:String):void
		{
			if(value!=this.part29Str && this.changePart("part29",value))
			{
				_part29Str=value;
			}
		}
		
		[Inspectable(type="String",defaultValue="default")]
		public function get part30Str():String
		{
			return _part30Str;
		}
		
		public function set part30Str(value:String):void
		{
			if(value!=this.part30Str && this.changePart("part30",value))
			{
				_part30Str=value;
			}
		}
		
		[Inspectable(type="String",defaultValue="default")]
		public function get part31Str():String
		{
			return _part31Str;
		}
		
		public function set part31Str(value:String):void
		{
			if(value!=this.part31Str && this.changePart("part31",value))
			{
				_part31Str=value;
			}
		}
		
		[Inspectable(type="String",defaultValue="default")]
		public function get part32Str():String
		{
			return _part32Str;
		}
		
		public function set part32Str(value:String):void
		{
			if(value!=this.part32Str && this.changePart("part32",value))
			{
				_part32Str=value;
			}
		}
		
		[Inspectable(type="String",defaultValue="default")]
		public function get part33Str():String
		{
			return _part33Str;
		}
		
		public function set part33Str(value:String):void
		{
			if(value!=this.part33Str && this.changePart("part33",value))
			{
				_part33Str=value;
			}
		}
		
		[Inspectable(type="String",defaultValue="default")]
		public function get part34Str():String
		{
			return _part34Str;
		}
		
		public function set part34Str(value:String):void
		{
			if(value!=this.part34Str && this.changePart("part34",value))
			{
				_part34Str=value;
			}
		}
		
		[Inspectable(type="String",defaultValue="default")]
		public function get part35Str():String
		{
			return _part35Str;
		}
		
		public function set part35Str(value:String):void
		{
			if(value!=this.part35Str && this.changePart("part35",value))
			{
				_part35Str=value;
			}
		}
		
		[Inspectable(type="String",defaultValue="default")]
		public function get part36Str():String
		{
			return _part36Str;
		}
		
		public function set part36Str(value:String):void
		{
			if(value!=this.part36Str && this.changePart("part36",value))
			{
				_part36Str=value;
			}
		}
		
		[Inspectable(type="String",defaultValue="default")]
		public function get part37Str():String
		{
			return _part37Str;
		}
		
		public function set part37Str(value:String):void
		{
			if(value!=this.part37Str && this.changePart("part37",value))
			{
				_part37Str=value;
			}
		}
		
		[Inspectable(type="String",defaultValue="default")]
		public function get part38Str():String
		{
			return _part38Str;
		}
		
		public function set part38Str(value:String):void
		{
			if(value!=this.part38Str && this.changePart("part38",value))
			{
				_part38Str=value;
			}
		}
		
		[Inspectable(type="String",defaultValue="default")]
		public function get part39Str():String
		{
			return _part39Str;
		}
		
		public function set part39Str(value:String):void
		{
			if(value!=this.part39Str && this.changePart("part39",value))
			{
				_part39Str=value;
			}
		}

	}
}